from bs4 import BeautifulSoup

# 单值属性
soup = BeautifulSoup('<b class="boldest">Extremely bold</b>')
tag = soup.b  #获取b标签
print(type(tag)) # 输出类型
print(tag.name)   # 输出tag名字
print(tag['class'])
print(tag.attrs)  # 输出属性
print(type(tag.attrs))  # 属性类型为字典